    <%
'Funcion para generar codigo de barra

'Code 39 barcodes require an asterisk as the start and stop characters
Response.write "<IMG SRC=""/expedientes/img/barcode/asterisk.gif"" WIDTH=""" & xwidth & """ HEIGHT=""" & xheight & """>"

For x = 1 to Len(Trim(BarCodeText))
	select case mid(BarCodeText,x,1)
		case " ":
			Response.Write "<IMG SRC=""/expedientes/img/barcode/space.gif"" WIDTH=""" & xwidth & """ HEIGHT=""" & xheight & """>"
		case "/":
			Response.Write "<IMG SRC=""/expedientes/img/barcode/slash.gif"" WIDTH=""" & xwidth & """ HEIGHT=""" & xheight & """>"
		case "+":
			Response.Write "<IMG SRC=""/expedientes/img/barcode/plus.gif"" WIDTH=""" & xwidth & """ HEIGHT=""" & xheight & """>"
		case "%":
			Response.Write "<IMG SRC=""/expedientes/img/barcode/percent.gif"" WIDTH=""" & xwidth & """ HEIGHT=""" & xheight & """>"
		case "-":
			Response.Write "<IMG SRC=""/expedientes/img/barcode/minus.gif"" WIDTH=""" & xwidth & """ HEIGHT=""" & xheight & """>"
		case "$":
			Response.Write "<IMG SRC=""/expedientes/img/barcode/dollar.gif"" WIDTH=""" & xwidth & """ HEIGHT=""" & xheight & """>"
		case "*":
			Response.Write "<IMG SRC=""/expedientes/img/barcode/asterisk.gif"" WIDTH=""" & xwidth & """ HEIGHT=""" & xheight & """>"
		case else									
			Response.Write "<IMG SRC=""/expedientes/img/barcode/" & mid(BarCodeText,x,1) & _
				 ".gif"" WIDTH=""" & xwidth & """ HEIGHT=""" & xheight & """>"
	end select
Next

'Code 39 barcodes require an asterisk as the start and stop characters
Response.write "<IMG SRC=""/expedientes/img/barcode/asterisk.gif"" WIDTH=""" & xwidth & """ HEIGHT=""" & xheight & """>"


    %>
